<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Welcome</title>
</head>
<body>
    <p th:text="'Hello,' + ${helloName} + '! Login Success'" >UserName</p>
    <div id="sp"></div>
</body>

<script th:inline="javascript">
	onload = function(){
		setInterval(go,1000);
	};
	var x = 3;
	function go(){
		x--;
		if(x>0){
			document.getElementById('sp').innerHTML = x;
		}else{
			alert("0000");
			var returnUrl = [[${originalUrl}]];
			location.href = returnUrl;
		}
	}
</script>
</html>